#define  _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<vector> 
#include<unordered_map>
using namespace std;


int main()
{
	unordered_map<int, int>cc;
	vector<int>dd{ 1,2,3,4,5,6,1 };
	for (auto d : dd) {

		++cc[d];
	}
	for (auto m : cc) {
		if (m.second == 2) {
			cout << m.first<<endl;
		}

	}
	cout << *(cc.end()-1);
	return 0;
}
